1. Field of the Invention
The present invention relates to an image processing apparatus and a method for controlling the apparatus, which corrects image data in accordance with a feature of the image data.
2. Description of the Related Art
Recently, digital cameras which record still images, sensed by image sensors, as digital data have widely been used. Along with an increased capacity of a memory card for recording images, storing a massive amount of photographed images has become a common practice. Since photographing and storing a massive amount of images has become easy, more images are photographed and stored casually with an inappropriate exposure amount. For instance, if an image is photographed with an underexposure state, the entire image turns out to be dark even if the photographed location is light. If the image, photographed with an underexposure state and stored, is to be displayed on a computer screen or printed out for viewing, it is preferable that appropriate correction be performed on the photographed image for compensating the overs and shorts of the exposure at the time of photography. Since it is extremely troublesome to manually perform such correction one by one on the massive amount of images, it is desirable that the overexposure or underexposure state of photographed images be automatically determined and correction be performed. However, it is difficult to automatically discriminate, for instance, an underexposed image from a nightscape image which is dark as a whole. In order to solve such problems, methods have been proposed for automatically discriminating an underexposed image from a nightscape image and executing appropriate correction.
Japanese Patent Application Laid-Open No. 2007-228221 (D1) discloses a method for determining a photographed scene and correcting a correction processing condition, which has been set based on the scene determination, in accordance with a night-scene index. The night-scene index described in D1 is calculated using the photograph conditions at the time of photography, skin color pixel information of the image, and average luminance of the entire image. The method according to D1 determines the scene of the photographed image, thereby automatically setting the correction condition. Further, by performing correction while taking night scene photography into consideration, an appropriately corrected image is acquired. However, in a case of determining a scene of a photographed image, if no photograph conditions are set at the time of photography or the setting conditions are replaced, scene determination cannot sufficiently be performed.
Further, Japanese Patent No. 04057147 (D2) discloses a backlit scene determination method that can judge whether or not a photographed image is a scene with backlight, without making errors even if the photographed image includes a dark portion other than the main object. In this method according to D2, it is not determined whether the image is a nightscape image or an underexposure landscape image having low brightness. For instance, in a nightscape, if the background is dark but part of the scene is lit by illumination, the illuminated part is judged not as a backlit scene. Moreover, if the dark part has low brightness and low saturation variance, it is wrongly determined as a backlit scene; therefore, the dark part of the nightscape is determined as a backlit scene. In this manner, if the dark part of the nightscape is wrongly determined as a backlit scene, it is undesirably corrected to a lighter image.
FIG. 10 depicts an image view in which image data are plotted in two-dimensional feature-amount space, having saturation variance values on the ordinate and average brightness values on the abscissa.
In FIG. 10, numeral 1110 (triangle) denotes a landscape image having an appropriate exposure; numeral 1111 (black square) denotes an underexposure landscape image; and numeral 1112 (black circle) denotes a nightscape image. Each shows an image in which brightness average values and saturation variance values are respectively plotted on the feature-amount space. The landscape image 1110 with an appropriate exposure has a high brightness average value and a high saturation variance value. The underexposure landscape image 1111 has a low brightness average value and a low saturation variance value. The nightscape image 1112 has a low brightness average value.
According to D2, in a case of determining whether or not a photographed image is a backlit scene, an image having, for example, a value less than or equal to the threshold value 1102 on the ordinate and a value less than or equal to the threshold value 1101 on the abscissa is determined as a backlit scene. However, both underexposed image and nightscape image are included in the area less than or equal to the threshold value 1102 on the ordinate and the threshold value 1101 on the abscissa. Therefore, it is impossible to discriminate, only with two threshold values, whether an image is an underexposed image or a nightscape image. Accordingly, determining a backlit scene cannot sufficiently be realized by the scene determination method in which a threshold value is set for each of the feature amounts.